package config

import (
	"flag"
)

var conf *Config

func init() {
	conf = newConfig()
}

type Config struct {
	ResultPath    string
	ImageSavePath string
	Port          int64
}

func newConfig() *Config {
	return &Config{}
}

func GetConfig() *Config {
	return conf
}

//AddFlags config
func (c *Config) AddFlags(fs *flag.FlagSet) {
	fs.Int64Var(&c.Port, "port", 9443, "server listening port")
	fs.StringVar(&c.ResultPath, "result-path", "/run/result", "the path where detection result json saved")
}